﻿
function hideAllItemTemplate() {

    dojo.query("[id*='ItemTemplate_']").forEach(function (tagElement) {
        tagElement.style.display = "none";
    });

}
function ShowHide(evt) {
    var divElementName = evt.currentTarget.id.replace("ImageApri", "ItemTemplate")
    dojo.query("[id='" + divElementName + "']").forEach(function (tagElement) {
        if (tagElement.style.display == "none") {
            tagElement.style.display = ""
            evt.currentTarget.childNodes[1].src = "../Styles/Images/Minus.png"

        }
        else {
            tagElement.style.display = "none"
            evt.currentTarget.childNodes[1].src = "../Styles/Images/Plus.png"

        }
    })
}

function AttachEvent() {
    dojo.query("div[id*='ImageApri_']").forEach(function (tagElement) {
        dojo.connect(tagElement, "onclick", null, "ShowHide");
    });
}


dojo.addOnLoad(
  function(){
      AttachEvent();
      hideAllItemTemplate();
})